<template>
  <div>
    <div class="singer" v-for="(item, index) in singerList" :key="item.index">
      <div class="left">
        <div class="leftleft">
          <div class="num">{{ index + 1 }}</div>
          <div class="gang">_</div>
        </div>
        <img :src="item.img1v1Url" alt="" class="img" />
      </div>
      <div class="right">
        <div class="name" @click="selectsingerlist(item)">{{ item.name }}</div>
        <img :src="hotimg" alt="" class="hotimg" />
        <div class="hot">{{ item.accountId }}</div>
      </div>
    </div>
  </div>
</template>
<script>
import axios from "axios";
export default {
  data() {
    return {
      singerList: [],
      hotimg: require("@/assets/hot.png"),
    };
  },
  created() {
    this.getsingerList();
  },
  methods: {
    getsingerList() {
      axios
        .get("api/artist/list?type=-1&area=8")
        .then((res) => {
          this.singerList = res.data.artists;
          console.log(this.singerList);
        })
        .catch((err) => {
          console.error(err);
        });
    },
    selectsingerlist(item) {
      const id = item.img1v1Id;
      this.$router.push({
        name: "Singerdetails",
        params: {
          id: id,
        },
      });
    },
  },
};
</script>
<style>
.singer {
  margin-top: 12px;
  display: flex;
  align-items: center;
}
.left {
  display: flex;
}
.leftleft {
  width: 40px;
  height: 40px;
  margin-top: 34px;
}

.name {
  display: table;
  margin-left: 5px;
}
.img {
  width: 100px;
  height: 100px;
  margin-top: 10px;
  margin-left: 10px;
  display: table;
  border-radius: 10%;
}
.hotimg {
  width: 20px;
  height: 20px;
  float: left;
  margin-top: 11px;
  display: table;
}
.hot {
  float: left;
  margin-top: 15px;
  display: table;
}
.right {
  margin-left: 5px;
}
</style>